﻿using System;
using System.Data;

namespace AuctionSite.Entities
{
    public class SubCategoria : IEntity<SubCategoria>
    {
        #region Propriedades

        public int Id { get; set; }
        public string Nome { get; set; }
        public int CategoriaId { get; set; }

        #endregion

        public SubCategoria Load(DataRow row)
        {
            if (row != null)
            {
                if (!string.IsNullOrEmpty(row["sub_id"].ToString()))
                {
                    this.Id = Convert.ToInt16(row["sub_id"]);
                    this.Nome = row["sub_nome"].ToString();
                    this.CategoriaId = Convert.ToInt16(row["cat_id"]);
                }
            }

            return this;
        }
    }
}